<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>life</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <div>{{msg}}</div>
    <input type="button" v-on:click="update" value="更新">
    <input type="button" v-on:click="destroy" value="销毁">
</div>

<script type="text/javascript">

    var app = new Vue({
        el: '#app',
        data: {
            msg: 'phpvue'
        },
        methods:{
            update:function(){
                this.msg=123;
            },
            destroy:function(){
                this.$destroy();
            }
        },

        beforeCreate: function () {
            console.log('beforeCreate')
        },
        created: function () {
            console.log('created')
        },
        beforeMount: function () {
            console.log('beforeMount')
        },
        mounted: function () {
            console.log('mounted')
        },
        beforeUpdate: function () {
            console.log('beforeUpdate')
        },
        updated: function () {
            console.log('updated')
        },
        beforeDestroy: function () {
            console.log('beforeDestroy')
        },
        destroyed: function () {
            console.log('destroyed')
        },


    })
</script>

</body>
</html>